home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 July / macformat-026.iso / mac / Shareware City / Developers / video-toolbox-95-01-14-c / VideoToolbox / Video attenuator < prev    next >
Encoding:
Text File  |  1995-01-14  |  13.7 KB  |  111 lines  |  [TEXT/ttxt]

  1. VideoToolbox: Video attenuator
  2. January 14, 1995 
  3.  
  4. THE ISR VIDEO ATTENUATOR
  5.  
  6. (Installation instructions are at the end of this file.)
  7. (The installation instructions have been expanded to deal with all of Apple's latest displays. You can do the upgrade yourself, or trade in your old attenuator for a new one.)
  8.  
  9. Macintosh computers are great for synthesizing and displaying images for vision experiments. However, the 8-bit resolution of their digital-to-analog converters is inadequate to render threshold-contrast stimuli, typically yielding on-screen contrasts that are only accurate to about 7 bits, because of the monitor's factor-of-two contrast gain. (RasterOps sells a few video cards with 9-bit DACs, but their video drivers have problems see the "Video bugs" document.) Pelli and Zhang (1991) describe a simple electronic circuit, a video attenuator, that provides accurate contrast control, achieving 12-bit on-screen accuracy from any 8-bit DAC. You can build one yourself, from their schematic, or you can order one pre-made from the Institute for Sensory Research, which calls it the "ISR Video Attenuator."
  10.  
  11. The ISR Video Attenuator is a small box that is inserted between the video cable and the Apple High-Resolution Monochrome Display. It combines the three color RGB signals from a color video card to produce a single monochrome signal of higher grayscale resolution. Only programs using special software (provided) will achieve this benefit. Physically, it is a small satin-finish machined-aluminum box, about the size of a matchbox (2"x1.2"x0.7"), with a 15-pin Apple video connector at each end. Inside are precision resistors on a two-sided printed circuit board with controlled-impedance microstrip traces. This passive resistor network combines the three 8-bit RGB signals from your video card to produce a single much-higher-accuracy signal to drive your Apple High-Resolution Monochrome Display.
  12.  
  13. IMPORTANT NOTE: The attenuator was designed in 1989. It was designed to attach to the monitor, not the computer, but many of Apple's new monitors have permanent cables, with no connector at the monitor, making it impossible to attach directly to the monitor. Attaching the Attenuator to the computer will result in it being installed backwards, resulting in a uselessly dim display. See instructions below on how to use gender changers to attach the Attenuator to the computer correctly. Furthermore, many pins that were unimportant in 1989 now carry essential signals for autosensing and synching the latest displays. Instructions for updating your Attenuator appear below.
  14.  
  15. D. G. Pelli and L. Zhang (1991) Accurate control of contrast on microcomputer displays. Vision Research, 31:1337-1360.
  16.  
  17. PACKING LIST
  18.  
  19. - ISR Video Attenuator. ISR stands for "Institute for Sensory Research".
  20. - Reprint of Pelli and Zhang (1991), which includes instructions for use and a schematic.
  21. - 3.5" Macintosh disk with free "VideoToolbox" C software for generating visual stimuli and making optimal use of the Video Attenuator on your Mac. The software is also available separately, still free. (I use this software. I think it's well documented and works well, but I'm not offering to support it. You're on your own. That's why the software is free.) However, there are some restrictions on distribution and commercial use of the VideoToolbox software. Please read the restrictions in its "Read me" file.
  22.  
  23. YOU WILL ALSO NEED
  24.  
  25. Macintosh-compatible monitor (if not 640x480 67 Hz then you must upgrade your Attenuator, see below)
  26. Macintosh color video card or built-in video
  27. photometer for luminance calibration
  28.  
  29. YOU MAY ALSO WANT TO HAVE
  30.  
  31. Cambridge University Press: Numerical Recipes in C
  32. Data Translation FORERUNNER A/D Card, or equivalent, to digitize photometer output
  33.  
  34. ORDERING INFORMATION
  35.  
  36. The ISR Video Attenuator is for research. As such it is licensed, not sold. The license has no time limit and is transferable. The accompanying Video Toolbox software for creating visual stimuli is supplied free, and is available separately to anyone, but may not be sold without permission.
  37.  
  38. Checks should be made payable to Syracuse University. The price of US$150 includes shipping in US. If you're in New York State then you either need to add sales tax or attach the New York State document excusing your institution from paying sales tax.
  39.  
  40. (ISR is planning to offer an upgraded attenuator, supporting autosensing, and accompanied by two gender changers--for compatibility with all Mac-compatible displays--both for new customers, and for customers wishing to trade-in their original attenuators for the upgraded model. However, prices have not yet been set. Please contact Art Wixson at the address below.)
  41.  
  42. SEND ORDERS TO
  43.  
  44. Electronics Shop
  45. Institute for Sensory Research
  46. Syracuse University
  47. Merrill Lane
  48. Syracuse, NY 13244-5290
  49. (315)-443-4164
  50. Art_Wixson@ISR.SYR.EDU
  51.  
  52. DISCLAIMER
  53.  
  54. Denis Pelli has no financial involvement in the ISR Video Attenuator.
  55.  
  56. INSTALLING THE ATTENUATOR AT THE MONITOR
  57.  
  58. To install your ISR Video Attenuator, unplug your video cable from your monitor, plug the cable into the attenuator and plug the attenuator into your monitor. Note that the ISR logo should be at the end of the attenuator that's closest to the monitor.
  59.  
  60. However, you can't do that if your monitor has a permanently attached cable or an incompatible connector. In that case, you'll have to install the attenuator at the computer end of the video cable.
  61.  
  62. INSTALLING THE ATTENUATOR AT THE COMPUTER
  63.  
  64. When the ISR Video Attenuator was designed in 1989 all Apple Macintosh modular computers connected to video monitors by means of a separate cable that plugged into both the computer and the display. The video attenuator was designed to plug into the back of the monitor, not the computer. If you plug it into the computer it will be backwards and won't work. (As noted above, the ISR logo should be at the end of the attenuator that's closest to the monitor.) Unfortunately, since 1989, Apple's cost-saving designs for their new monitors have replaced the connector at the back of the monitor by a permanent cable, making it impossible to install the video attenuator as originally intended. The solution is to buy a pair of gender changers, one for each end of the video attenuator, so that it can be installed in the correct orientation at the back of the computer. You can make your own gender changers, or buy any brand, but those made by GC Electronics are particularly compact and inexpensive. Buy both the GC Electronics male-to-male 15-pin D gender changer 45-0527 for $6.65 and their female-to-female 15-pin D gender changer part number 45-0528 for $6.65. They are sold by most electronics supply houses, e.g. Newark Electronics. Put a gender changer at either end of your video attenuator, plug it into your computer's video port, and plug the monitor's video cable into it.
  65.  
  66. UPGRADING YOUR VIDEO ATTENUATOR TO SUPPORT AUTOSENSING & MULTI-RESOLUTION MONITORS
  67.  
  68. When the printed circuit for the video attenuator was designed  in 1989, video pins 4, 7, 10, 11, 12, and 15 were not important. Since then Apple has defined pins 4, 7, and 10 as Monitor Sense Pins, and pins 11, 12 and 15 as carrying horizontal and vertical synch. (For details read Apple's "HW.30 Sense Lines.note" in the VideoToolbox:Notes folder.) To use your ISR Video Attenuator with anything other than a 640x480 67 Hz display, e.g. a multiple-resolution monitor, you need to update the Video Attenuator to pass those 6 signals through, unmodified. After this update your Video Attenuator will be compatible with all computers and monitors that use Macintosh-compatible 15-pin D video connectors. (As always, when used with a color monitor only the green gun will be used.) If you're comfortable with a soldering iron you can do this in about 15 minutes. Alternatively, you may prefer to contact Art Wixson at the address above about trading in your current Attenuator for an upgraded one.
  69.  
  70. Unscrew and remove the standoffs on either side of the female 15-pin connector (otherwise you won't be able to open the case). Use a 5/64 inch Allen key to unscrew the allen screw in the middle of the ISR Video Attenuator. Remove the metal case (top and bottom). Place the circuit board on the table so that you can see the resistors and the male connector (with 15 gold-plated pins) is on the right. You can now see the connections of pins 1 to 8 to the circuit board. On both right and left of the circuit board, pin 1 is nearest you, then pin 2, ...,  and pin 8 is furthest from you. Use an X-acto or razor blade to cut the copper foil connected to pin 4 on both the right and the left. Scrape or fold back the foil to create a visible gap, to make sure the break is permanent. Now solder a wire connecting pin 4 on the left to pin 4 on the right. (Any wire will do, but 22 gauge solid conductor insulated wire is particularly easy to handle.) Now solder a wire connecting pin 7 on the left to pin 7 on the right. Now turn the printed circuit upside down, so the resistors are hidden, and the male connector is on your left. Pins 9 to 15 are now visible. Pin 9 is nearest to you, on both right and left. Now solder a wire connecting pin 10 on the left to pin 10 on the right. Similarly, connect pin 11 to 11, 12 to 12, and 15 to 15. The video attenuator is now functional. You may test it now, before putting the case back on. The standard orientation for the case is to put the plain piece on the side of the circuit board with no resistors, and the labeled piece ("VIDEO ATTENUATOR") on the side with resistors, oriented so that the writing is right-side up when the male connector is on your right. (You needn't bother to replace the stand-offs, since the gender changers won't use them.) You're done. Your updated Video Attenuator is compatible with all computers and monitors that use Macintosh-compatible 15-pin D video connectors.
  71.  
  72. CALIBRATION
  73.  
  74. Once the attenuator is installed, you should run the program CalibrateLuminance to calibrate your monitor, attenuator, and video card. You will need a photometer in order to use that program. Once it's finished CalibrateLuminance will produce a new file called LuminanceRecord?.h, where "?" is the screen number of your monitor. (This screen number is similar to but not the same as the monitor number used by the Monitors control panel device.) This file describes the gamma function and RGB gains of your video card and attenuator. It is a C header file. You can cause its contents to be included in any program by writing
  75.      #include <LuminanceRecord1.h>
  76. where "1" must be replaced by the screen number of your monitor, as determined by the program CalibrateLuminance or the subroutine GetScreenDevice(). Alternatively,
  77. you can read the file at runtime by calling
  78.      ReadLuminanceRecord("LuminanceRecord1.h",&LR,0);
  79. where &LR is a pointer to your luminance record struct. I recommend the latter approach, because it makes your program portable across monitors. Later, when you write programs (or compile the supplied demonstrations), your LuminanceRecord file will allow them to accurately control the luminance of your display. The relevant subroutines are all in the file called Luminance.c. Documentation is in the file Luminance.h. Note that LuminanceRecord1.h and LuminanceRecord2.h are provided as samples in the VideoToolboxSources folder, so that the demonstration programs can be compiled even before you have calibrated your own display. However, before doing any serious experiment it is essential that you replace the example by a new LuminanceRecord file that describes your own display.
  80.  
  81. Alternatively, you can read the LuminanceRecord?.h file at runtime, using the new subroutine ReadLuminanceRecord.c in the VideoToolbox.
  82.  
  83. The ISR video attenuator is intended for use with the Apple High-Resolution Monochrome Display. It also works perfectly with the Apple High Resolution RGB Display, but uses only the green input, ignoring the monitor's red and blue inputs.
  84.  
  85. With a minor modification, the ISR video attenuator can be used with any monitor that uses the Apple standard D-15 connector and accepts a separate synch. Subsequent to manufacture of the ISR video attenuator, Apple introduced new video cards that automatically sense the particular kind of monitor that is attached. To do this they use pins 4, 7, and 10 of their 15-pin video connector as sense lines. These pins were formerly either grounded (pin 4) or unused (pins 7 and 10). All the video cards currently sold by Apple (and the built in video of the newer Macs) have auto-sensing. These video cards will be fooled by the ISR attenuator (since it grounds pin 4 and leaves pins 7 and 10 open) into thinking that they are connected to an Apple High-Resolution Monochrome or RGB Display (both have 640x480 pixels at 67 Hz). If you want to use a different display you could either make yourself a custom cable, copying the treatment of pins 4, 7, & 10 from your monitor, or you could modify the ISR Video Attenuator. The modification is to disconnect the ISR attenuator's pin 4 from ground, on both input and output connectors, and to wire the input sensing pins to the output sensing pins, i.e. 4 to 4, 7 to 7, and 10 to 10. This will allow your video card to correctly sense the monitor type.
  86.  
  87. Good luck.
  88.  
  89. APPENDIX 1: The pin-out of Apple Video connectors, from Apple.
  90.  
  91. Table 2  Signal Assignments for the DB-15 External Video Connector
  92.  
  93. Pin    Signal Name    Signal Description
  94. 1    RED.GND    Red Ground
  95. 2    RED.VID    Red Video Signal
  96. 3    /CSYNC    Composite Sync Signal
  97. 4    SENSE0    Monitor Sense Line 0
  98. 5    GRN.VID    Green Video Signal
  99. 6    GRN.GND    Green Ground
  100. 7    SENSE1    Monitor Sense Line 1
  101. 8    n.c.    Not Connected
  102. 9    BLU.VID    Blue Video Signal
  103. 10    SENSE2    Monitor Sense Line 2
  104. 11    C&VSYNC.GND    Ground for CSYNC & VSYNC
  105. 12    /VSYNC    Vertical Sync Signal
  106. 13    BLU.GND    Blue Ground
  107. 14    HSYNC.GND    HSYNC Ground
  108. 15    /HSYNC    Horizontal Sync Signal
  109.  
  110. For explanation see Apple's Tech Note "HW 30 - Sense Lines.note", which you can find in the VideoToolbox:Notes folder.
  111.